package com.imot.controller;

import com.imot.response.Result;
import com.imot.service.HealthyStatusService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import lombok.RequiredArgsConstructor;
import lombok.extern.slf4j.Slf4j;
import org.springframework.web.bind.annotation.*;

/**
 * ClassName: HealthyStatusController
 * Description:
 * date: 2023/11/13 14:05
 *
 * @author imot-jiah.wang
 */
@Api(tags = "健康态势控制器")
@Slf4j
@RestController
@RequiredArgsConstructor
@RequestMapping("/api/healthy")
public class HealthyStatusController {
    private final HealthyStatusService healthyStatusService;

    @ApiOperation("获取健康态势得状态")
    @GetMapping("/getHealthyStatus")
    public Result getHealthyStatus() {
        Result result = healthyStatusService.getHealthyStatus();
        return result;
    }

    @ApiOperation("历史告警统计")
    @GetMapping("/getHistAlertStats")
    public Result getHistAlertStats(){
        Result result = healthyStatusService.getHistAlertStats();
        return result;
    }

    @ApiOperation("故障类别统计")
    @GetMapping("getFaultCategoryStats")
    public Result getFaultCategoryStats(){
        Result result = healthyStatusService.getFaultCategoryStats();
        return result;
    }

    @ApiOperation("获取失效率波形图")
    @PostMapping("/getFailureRateWaveform")
    public Result getFailureRateWaveform(){
        Result result = healthyStatusService.getFailureRateWaveform();
        return result;
    }
}

